﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterView.ascx.cs" Inherits="Administration_Views_RegisterView" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxControlToolkit" %>
<%@ Register TagPrefix="spring" Namespace="Spring.Web.UI.Controls" Assembly="Spring.Web" %>

<spring:DataBindingPanel ID="dataBindingPanel" runat="server">
    <table>
        <tr>
            <td class="detailsFormHeader">
                Personal Info
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label1" Text="Name:" runat="server" />
                        </td>
                        <td>
                            <asp:TextBox ID="nameTextBox" BindingTarget="Person.Name" CssClass="detailsFormTextBox" runat="server" />
                            <asp:RequiredFieldValidator ID="nameRequiredFieldValidator" ControlToValidate="nameTextBox" Display="None"
                                                        ErrorMessage="Name is required" runat="server" />
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="nameRequiredValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="nameRequiredFieldValidator"  
                                                                         runat="server" />                         
                        </td>                                                   
                    </tr>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label2" Text="Surname:" runat="server" />
                        </td>                        
                        <td class="detailsFormValue">
                            <asp:TextBox ID="surnameTextBox" BindingTarget="Person.Surname" CssClass="detailsFormTextBox" runat="server" />
                            <asp:RequiredFieldValidator ID="surnameRequiredFieldValidator" ControlToValidate="surnameTextBox" Display="None"
                                                        ErrorMessage="Surname is required" runat="server" />
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="surnameRequiredValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="surnameRequiredFieldValidator"  
                                                                         runat="server" />                                
                        </td>                                                                     
                    </tr>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label3" Text="Login:" runat="server" />
                        </td>
                        <td class="detailsFormValue">                        
                            <asp:TextBox ID="loginTextBox" BindingTarget="Person.Login" CssClass="detailsFormTextBox" runat="server" />
                            <asp:RequiredFieldValidator ID="loginRequiredFieldValidator" ControlToValidate="loginTextBox" Display="None" 
                                                        ErrorMessage="Login is required" runat="server" />
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="loginRequiredValidatorCalloutExtender1"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="loginRequiredFieldValidator"  
                                                                         runat="server" />                                 
                        </td>
                    </tr>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label4" Text="Email:" runat="server" />
                        </td>                        
                        <td class="detailsFormValue">
                            <asp:TextBox ID="emailTextBox" BindingTarget="Person.Email" CssClass="detailsFormTextBox" runat="server" />
                            <asp:RequiredFieldValidator ID="emailRequiredFieldValidator" ControlToValidate="emailTextBox" Display="None"
                                                        ErrorMessage="Email is required" runat="server" />
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="emailRequiredValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="emailRequiredFieldValidator" runat="server" />
                            <asp:RegularExpressionValidator ID="emailRegularExpressionValidator" ControlToValidate="emailTextBox" Display="None"                                     
                                                            ValidationExpression="^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$" ErrorMessage="Invalid email address" runat="server" />    
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="emailValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="emailRegularExpressionValidator"  
                                                                         runat="server" />                                                                                                     
                        </td>                                                                     
                    </tr>                                                             
                </table>                                                             
            </td>
        </tr>                                                                                      
        <tr>
            <td class="detailsFormHeader">
                Played Role
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label5" Text="Role:" runat="server" />
                        </td>
                        <td class="detailsFormValue">
                            <spring:RadioButtonGroup ID="roleCodeRadioButtonGroup" BindingTarget="PlayedRole.RoleCode" runat="server">
                                <asp:RadioButton ID="operational" Text="Operational" runat="server" />
                                <asp:RadioButton ID="administrator" Text="Administrator" runat="server" />
                                <asp:RadioButton ID="external_operational" Text="External tool" runat="server" />
                            </spring:RadioButtonGroup>
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label6" Text="Start date:" runat="server" />
                        </td>
                        <td class="detailsFormValue">
                            <asp:TextBox ID="startDateTextBox" BindingTarget="PlayedRole.StartDate" CssClass="detailsFormTextBox" runat="server" />
                            <ajaxControlToolkit:CalendarExtender ID="startDateCalendarExtender" Format="yyyy/MM/dd"
                                                                 TargetControlID="startDateTextBox"
                                                                 runat="server" />
                            <asp:RequiredFieldValidator ID="startDateRequiredFieldValidator" ControlToValidate="startDateTextBox" Display="None"
                                                        ErrorMessage="Role start date is required" runat="server" />    
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="startDateRequiredValidatorCalloutExtender" HighlightCssClass="highlightValidatorCallout"
                                                                         TargetControlID="startDateRequiredFieldValidator" runat="server" />
                            <asp:RegularExpressionValidator ID="startDateRegularExpressionValidator" ControlToValidate="startDateTextBox" Display="None"
                                                            ValidationExpression="^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1]))$|^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$"
                                                            ErrorMessage="Valid date format is yyyy-MM-dd" runat="server" />                                                                                                                                                                                              
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="startDateREValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout"
                                                                         TargetControlID="startDateRegularExpressionValidator" runat="server" />                                                        
                        </td>
                    </tr>
                    <tr>
                        <td class="detailsFormLabel">
                            <asp:Label ID="Label7" Text="End date:" runat="server" />
                        </td>
                        <td class="detailsFormValue">
                            <asp:TextBox ID="endDateTextBox" BindingTarget="PlayedRole.EndDate" CssClass="detailsFormTextBox" runat="server" />
                            <ajaxControlToolkit:CalendarExtender ID="endDateCalendarExtender" Format="yyyy/MM/dd" 
                                                                 TargetControlID="endDateTextBox" runat="server" />
                            <asp:RequiredFieldValidator ID="endDateRequiredFieldValidator" ControlToValidate="endDateTextBox" Display="None"
                                                        ErrorMessage="Role end date is required" runat="server" />
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="endDateRequiredValidatorCalloutExtender" HighlightCssClass="highlightValidatorCallout"
                                                                         TargetControlID="endDateRequiredFieldValidator" runat="server" /> 
                            <asp:RegularExpressionValidator ID="endDateRegularExpressionValidator" ControlToValidate="endDateTextBox" Display="None"
                                                            ValidationExpression="^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1]))$|^([2][0]\d{2}\/([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$"
                                                            ErrorMessage="Valid date format is yyyy-MM-dd" runat="server" />                                                                                                                                                                                              
                            <ajaxControlToolkit:ValidatorCalloutExtender ID="endDateREValidatorCalloutExtender"  HighlightCssClass="highlightValidatorCallout" 
                                                                         TargetControlID="endDateRegularExpressionValidator" runat="server" />                                                                          
                        </td>
                    </tr>
                </table>
            </td>                            
        </tr>                        
    </table>
    <asp:Panel ID="Panel1" CssClass="detailsFormCommandPanel" runat="server">            
        <asp:LinkButton ID="registerLinkButton" Text="Register" 
                    OnClick="registerLinkButton_Click" runat="server" />         
    </asp:Panel>                                                                                      
</spring:DataBindingPanel>